<%@ page import="com.iflytek.management.pojo.SysUser" %><%--
  Created by IntelliJ IDEA.
  User: computer
  Date: 2021/6/6
  Time: 14:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<% String path = request.getContextPath();
   String basepath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;%>
<%SysUser user = (SysUser) session.getAttribute("user");%>
<%SysUser userd = (SysUser) session.getAttribute("userd");%>
<h1 align="center" style="color: #1a54e8">个人资料</h1>
<table class="edituser">
    <tr>
        <td style="padding: 10px 30px">
            <table class="pic">
                <tr>
                    <td style="width: 60px;"><span style="margin: auto 20px">头像:</span><img id="headimg" src="${userd.pic==null?"<%=basepath %>/static/image/admin.png":userd.pic}" alt="" style="width: 100px; height: 100px"></td>
                </tr>
                <tr>
                    <td><br></td>
                </tr>
                <tr>
                    <td>
                        <form id="uploadform" method="post" enctype="multipart/form-data" target="iframeName"
                              action="http://localhost:8080/Management/UploadServlet?id=${userd.id}">
                            <input type="file" name="pic" style="width: 200px"><br>
                            <button>上传</button>
                        </form>
                        <iframe src="" frameborder="0" name="iframeName"></iframe>
                    </td>
                </tr>
            </table>
        </td>
        <td>
            <div class="sx"></div>
        </td>
        <td style="padding: 10px 30px">
            <table class="update">
                <tr>
                    <td>姓名</td>
                    <td><span>${userd.name }</span></td>
                    <td><button onclick="editUser(${userd.id},1)">编辑</button></td>
                </tr>
                <tr>
                    <td>账号</td>
                    <td><span>${userd.userName}</span></td>
                </tr>
                <tr>
                    <td>Email</td>
                    <td><span>${userd.email}</span></td>
                </tr>
                <tr>
                    <td>所属公司</td>
                    <td><span>${userd.company}</span></td>
                </tr>
                <tr>
                    <td>手机号</td>
                    <td><span>${userd.phone}</span></td>
                </tr>
                <tr>
                    <td>角色</td>
                    <td>
                        <span>
                            ${userd.roleid == '1'?"管理员":""}
                            ${userd.roleid == '2'?"项目经理":""}
                            ${userd.roleid == '3'?"普通员工":""}
                        </span>
                    </td>
                </tr>
                <tr>
                    <td>部门</td>
                    <td>
                        <span>
                            ${userd.department== 1?"销售部":""}
                            ${userd.department== 2?"项目部":""}
                                ${userd.department== 3?"研发部":""}
                        </span>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>